import request from '@/config/axios'

export interface SpeechVO {
  id: number
  title: string
  content: string
}

// 查询话术列表
export const getSpeechPage = async (params) => {
  return await request.get({ url: `/call/speech/page`, params })
}

// 查询话术详情
export const getSpeech = async (id: number) => {
  return await request.get({ url: `/call/speech/get?id=` + id })
}

// 查询话术列表
export const getSpeechList = async () => {
  return await request.get({ url: `/call/speech/list` })
}

// 新增话术
export const createSpeech = async (data: SpeechVO) => {
  return await request.post({ url: `/call/speech/create`, data })
}

// 修改话术
export const updateSpeech = async (data: SpeechVO) => {
  return await request.put({ url: `/call/speech/update`, data })
}

// 删除话术
export const deleteSpeech = async (id: number) => {
  return await request.delete({ url: `/call/speech/delete?id=` + id })
}

// 导出话术 Excel
export const exportSpeech = async (params) => {
  return await request.download({ url: `/call/speech/export-excel`, params })
}
